package com.yopuo.common.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * 读取阿里云相关配置
 *
 * @author zzh
 */
@Component
@ConfigurationProperties(prefix = "oss.aliyun")
@Data
public class OssAliyunConfig
{
    /** 访问域名 */
    private static String domain;

    /** 末点 */
    private static String endPoint;

    /** 公钥 */
    private static String accessKeyId;

    /** 私钥 */
    private static String accessKeySecret;

    /** 存储空间名称 */
    private static String bucketName;

    /** 前缀名 */
    private static String prefix;

    public void setDomain(String domain) {
        OssAliyunConfig.domain = domain;
    }

    public void setEndPoint(String endPoint) {
        OssAliyunConfig.endPoint = endPoint;
    }

    public void setAccessKeyId(String accessKeyId) {
        OssAliyunConfig.accessKeyId = accessKeyId;
    }

    public void setAccessKeySecret(String accessKeySecret) {
        OssAliyunConfig.accessKeySecret = accessKeySecret;
    }

    public void setBucketName(String bucketName) {
        OssAliyunConfig.bucketName = bucketName;
    }

    public void setPrefix(String prefix) {
        OssAliyunConfig.prefix = prefix;
    }

    public static String getDomain() {
        return domain;
    }

    public static String getEndPoint() {
        return endPoint;
    }

    public static String getAccessKeyId() {
        return accessKeyId;
    }

    public static String getAccessKeySecret() {
        return accessKeySecret;
    }

    public static String getBucketName() {
        return bucketName;
    }

    public static String getPrefix() {
        return prefix;
    }
}
